<?php
/**
 * Auth
 * @filesource
 */
/**
 * Namespace
 */
namespace framework\library\authentication;
/**
 * Dependencies
 */
/**
 * Plurious Auth Configuration
 *
 * Authentication and Authorization for Plurious
 *
 * @author Randy Casburn <randy@plurious.com>
 * @copyright Copyright Plurious Software, all rights reserved
 * @license MIT
 * @license http://www.opensource.org/licenses/mit-license.html
 * @link http://plurious.com/framework/documentation/classes/Front.html
 * @version 2.1
 */

/*
| -------------------------------------------------------------------------
| User Authentication Library configuration
| -------------------------------------------------------------------------
| This contains configuration parameters for the Auth library
*/
/**
* Basic security Setting
* 
* How many times can a user input the wrong password before they are automatically
* locked out of the system?
*                              
* Setting this to Zero (0) will allow unlimited attempts and is NOT recommended.
*/
$cfg['auth_auto_lock_after'] = '0';
/**
 * Server Certificate
 *
 * This configuration parameter is used to buid a server side hash to help
 * control and verify that the userid stored in the session has not been modified on the client.
 * This can be any string
 */
$cfg['server_certificate']='[@1#$^asdf#SfSGHe#$4SysRtdfgRtsFGeR6uyMGHedrt]';
/**
* Database configuration
* 
*/
/* Database name */
$cfg['auth_db'] = 'plurious_users';
/* Table Names */
$cfg['users_table'] = 'users';
$cfg['seeds_table'] = 'seeds';
/* Column Names */
$cfg['UserIdCol'] = 'id';
$cfg['UserNameCol'] = 'username';
$cfg['NiceNameCol'] = 'nicename';
$cfg['PasswordCol'] = 'pw';
/* References */
$cfg['RememberMe'] = 'rememberme';
$cfg['seedLabel'] = 'keyid';

/**
* Mutually Exclusive Options - Enhance security / Weaken Security
* 
* Password Enhance - an adaptation of Captcha - requires the user to insert random characters
*                     at the beginning or end of their existing password while typing
*                     their password into the text field - while this enhances security, it
*                     is a pain in neck for the users and should be carefully scrutinized
*                     as a necessary security measure before kicking your users in the shin
* 
* Offer Remember - This is the remember me function - this is just the opposite of the above.
*                  Why require any security, just remember the user's credentials so they can
*                  be lazy, anyone can use their account, they have an excuse for doing bad 
*                  things and blaming it on someone else....you get it.  So like the other
*                  option, carefully scrutinize the necessity of severly limiting your security
*                  by enabling this option.
* 
* These options are mutually exclusive - you shouldn't expect to use a 'more secure' password  
* method and at the same time expect to be able to bypass it with a 'remember me' option
* Boolean
* 
*/
$cfg['auth_password_enhance'] = false;
$cfg['auth_offer_remember']    = true;
/** 
* expiration of the 'remember me' 
* Expects a string such as '3 day', '1 week', '1 month', '1 year', etc.
* See the documentation for strtotime();
*/
$cfg['auth_expire_after'] = '1 month';
/**
 * Minimum password length
 */
$cfg['auth_min_password_length'] = 5;
/**
* Password Enhance Text - This is a text block that is shown to the user at log in or registration.
* (corresponds to auth_password_enhance above)
*   - The user is instructed to choose a very specific character from within this
*     passage and to place it within their password as they
*    type it into the password field.
*
*     If they do not follow these instructions properly, they will not authenticate.
*
*     Must be a single line of text no special characters.  
* 
* NOTE: This is similar to Captcha and uses the same principle.
*/
$cfg['auth_enhance_text'] = "With the possible exception of the equator, everything begins somewhere. C. S. Lewis";
/*
|--------------------------------------------------------------------------
| Password Enhancement
|--------------------------------------------------------------------------
|
| You can set the enhancement catpcha created by the Auth library here.
| 'auth_captcha_path' = Directory where the catpcha will be created. 
| 'auth_captcha_fonts_path' = Font in this directory will be used when creating captcha.
| 'auth_captcha_font_size' = Font size when writing text to captcha. Leave blank for random font size.
| 'auth_captcha_grid' = Show grid in created captcha.
| 'auth_captcha_expire' = Life time of created captcha before expired, default is 3 minutes (180 seconds).
|
*/

$cfg['auth_captcha_path'] = './captcha/';
$cfg['auth_captcha_fontpath'] = $cfg['auth_captcha_path'].'fonts'; 
$cfg['auth_captcha_width'] = 300;
$cfg['auth_captcha_height'] = 80;
$cfg['auth_captcha_font_size'] = ''; 

/**
 * DEFINES for success/failure modes 
 */
define('AUTH_FAILURE_ACCOUNT_INACTIVE', -6001);
define('AUTH_FAILURE_ACCOUNT_LOCKED', -5001);
define('AUTH_FAILURE_UNKNOWN', -4001);
define('AUTH_FAILURE_CREDENTIAL_INVALID', -3001);
define('AUTH_FAILURE_IDENTITY_AMBIGUOUS', -2001);
define('AUTH_FAILURE_IDENTITY_NOT_FOUND', -1001);
define('AUTH_FAILURE', 0);
// This MUST be the only GREATER THAN ZERO value //
define('AUTH_SUCCESS', 1);
// These are Constants for Action Error Messages //
define('AUTH_ACTION_ARGS_INCORRECT', 'a220');
define('AUTH_ACTION_ADD_SUCCESS', 'a340');
define('AUTH_ACTION_DUPLICATE_USERNAME', 'a330');
define('AUTH_ACTION_NOUSERS_TOLIST', 'a331');
define('AUTH_ACTION_UPDATE_SUCCESS', 'a342');
define('AUTH_ACTION_UPDATE_FAILED', 'a332');
define('AUTH_ACTION_DELETE_SUCCESS', 'a343');
define('AUTH_ACTION_DELETE_FAILED', 'a333');
define('AUTH_ACTION_LOCK_SUCCESS', 'a344');
define('AUTH_ACTION_LOCK_FAILED', 'a334');
define('AUTH_ACTION_UNLOCK_SUCCESS', 'a345');
define('AUTH_ACTION_UNLOCK_FAILED', 'a335');
define('AUTH_ACTION_ACTIVATE_SUCCESS', 'a346');
define('AUTH_ACTION_ACTIVATE_FAILED', 'a336');
define('AUTH_ACTION_DEACTIVATE_SUCCESS', 'a347');
define('AUTH_ACTION_DEACTIVATE_FAILED', 'a337');
define('AUTH_ACTION_BLOCKIP_SUCCESS', 'a348');
define('AUTH_ACTION_BLOCKIP_FAILED', 'a338');
define('AUTH_ACTION_UNBLOCKIP_SUCCESS', 'a349');
define('AUTH_ACTION_UNBLOCKIP_FAILED', 'a339');
define('AUTH_ACTION_IMPORT_SUCCESS', 'a350');
define('AUTH_ACTION_IMPORT_FAILED', 'a351');



?>
